package com.yunhai.model.entity.ums;

import com.baomidou.mybatisplus.annotation.*;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.yunhai.model.base.BaseEntity;
import com.yunhai.model.entity.tms.TmsStoreEntity;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.experimental.Accessors;

import java.io.Serial;
import java.io.Serializable;
import java.time.LocalDateTime;
import java.util.List;

@ApiModel(value = "UmsUser", description = "用户实体")
@TableName("ums_user")
@Data
@Accessors(chain = true)
public class UmsUser  extends BaseEntity implements Serializable {

    @Serial
    private static final long serialVersionUID = -8329305269340429100L;


    @ApiModelProperty(value = "主键ID", example = "1917583197156151299")
    @TableId(type = IdType.ASSIGN_ID)
    private Long id;

    @ApiModelProperty(value = "微信openid", example = "o6_bmjrPTlm6_2sgVt7hMZOPfL2M")
    private String openid;

    @ApiModelProperty(value = "用户名", required = true, example = "john_doe")
    private String userName;

    @ApiModelProperty(value = "用户昵称", required = true, example = "John")
    private String nickName;

    @ApiModelProperty(value = "密码", required = true, hidden = true)
    @JsonIgnore
    private String password;

    @ApiModelProperty(value = "密码盐", hidden = true)
    private String salt;

    @ApiModelProperty(value = "账号状态（0正常 1停用）", example = "0")
    private String status;

    @ApiModelProperty(value = "手机号码", example = "13800138000")
    private String phonenumber;

    @ApiModelProperty(value = "用户性别（0男，1女，2未知）", example = "0")
    private String sex;

    @ApiModelProperty(value = "头像地址", example = "https://avatar.com/1.jpg")
    private String avatar;

    @ApiModelProperty(value = "用户类型（0管理员，1普通用户）", example = "1")
    private String userType;

    @TableField( exist = false )
    private List<Long> roleIdList;

    @TableField( exist = false )
    private List<UmsRole> roleList;

    @TableField( exist = false )
    private List<TmsStoreEntity> storeList;

}
